<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<!DOCTYPE html>
	<html lang="en" class="no-ie" style="overflow:hidden;">
		<head>
			<meta charset="UTF-8">
			<title>不合格商品提示</title>
			<script>
				"object" != typeof ue || "object" != typeof ue.interface ? ("object" != typeof ue && (ue = {}), ue.interface = {},
					ue.interface.broadcast = function(e, t) {
						if ("string" == typeof e) {
							var o = [e, ""];
							void 0 !== t && (o[1] = t);
							var n = encodeURIComponent(JSON.stringify(o));
							"object" == typeof history && "function" == typeof history.pushState ? (history.pushState({}, "",
								"#" + n), history.pushState({}, "", "#" + encodeURIComponent("[]"))) : (document.location
								.hash = n, document.location.hash = encodeURIComponent("[]"))
						}
					}) : function(e) {
					ue.interface = {}, ue.interface.broadcast = function(t, o) {
						"string" == typeof t && (void 0 !== o ? e.broadcast(t, JSON.stringify(o)) : e.broadcast(t, ""))
					}
				}(ue.interface), (ue4 = ue.interface.broadcast);
			</script>
			<script src="./dist/echarts-5.3.2.min.js"></script>
			<script src="./static/js/jquery.min.js"></script>
			<style>
				* {
					margin: 0;
					padding: 0;
				}
			</style>
		</head>
		<body>
			<div id="main"></div>
			<!--
		dataTemp1: y轴数值;dataTemp2: x轴标题
		
		-->
			<script>
				let BeginSize = [228, 228];
				let myChart = null;
				let dataList={
					name:'省外占比',
					value:[30,100] //第一个值，第二个百分比
				}
				function fresh() {
					let baifei = ((dataList.value[0]/dataList.value[1])*100).toFixed(0)
					// 准备待返回的配置项，把准备好的 legendData、series 传入。
					let option = {
						backgroundColor: '#03060F',
						angleAxis: {
							max: 100,
							clockwise: true, // 逆时针
							// 隐藏刻度线
							show: false,
							startAngle: 110,
						},
						radiusAxis: {
							type: 'category',
							show: true,
							axisLabel: {
								show: false,
							},
							axisLine: {
								show: false,

							},
							axisTick: {
								show: false
							},
						},
						polar: [{
							center: ['50%', '50%'], //中心点位置
							radius: ['83%', '60%'],
						}],
						series: [{
								type: 'bar',
								z: 10,
								data: [baifei],
								showBackground: false,
								coordinateSystem: 'polar',
								roundCap: true,
								barWidth: 25,
								
								itemStyle: {
									normal: {
										opacity: 1,
										color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [{
											offset: 0,
											color: 'rgba(68, 129, 235, 1)'
										}, {
											offset: 1,
											color: 'rgba(4, 190, 254, 1)'
										}])
									}
								},
							},
							{
								type: 'pie',
								name: '内层细圆环',
								radius: ['80%', '60%'],
								center: ['50%', '50%'],
								startAngle: 110,
								hoverAnimation: false,
								clockWise: true,
								itemStyle: {
									normal: {
										color: 'rgba(230, 247, 255, 0.3)'
									}
								},
								tooltip: {
									show: false,
								},
								labelLine: {
								      show: false
								    },
								label: {
									show: true,
									position:'center',
									// padding: [0, 0, 0, -40],
									formatter:function(data){
										return "{a|"+`${dataList.value[0]}`+"}"+"{b|个}"
									},
									rich:{
										a:{
											fontSize:48,
											color:'#FFFFFF'
										},
										b:{
											fontSize:26,
											color:'#FCFCFC'
										}
									}
								},
								data: [dataList.value[1]]
							}
						]
					};
					myChart = echarts.init(document.getElementById('main'));
					myChart.clear();
					myChart.setOption(option);
				}

				fresh();


				//浏览器测试用
				change(BeginSize[0], BeginSize[1]);
				changeBorder('red', false, 'topl', 10);
				//fresh();

				function LinkUE4() {
					//alert("I am an alert box!!");
					//ue4("getData2",{mes:"get all data"});
					ue4("CallBack", {}, function(v) {
						alert("I am an alert box!!");
					});
				};

				function change(x, y) {
					let div = document.getElementById("main");
					//alert("I am an alert box!!");
					div.style.width = x + "px";
					div.style.height = y + "px";
					var myOption = myChart.getOption();
					myChart.resize();
					let types = []
					myOption.series.forEach((item) => {
						types.push(item.type)
					})
					return types
				}

				function changeBorder(x, y, p, n) {
					let div = document.getElementById("main");
					div.style.border = `0px solid ${x}`;
					if (y) {
						div.style.borderRadius = '10px'
					} else {
						if (p = 'topl') {
							div.style.borderTopLeftRadius = n + 'px';
						} else if (p = 'topr') {
							div.style.borderTopRightRadius = n + 'px';
						} else if (p = 'bottoml') {
							div.style.borderBottomLeftRadius = n + 'px';
						} else if (p = 'bottomr') {
							div.style.borderBottomRightRadius = n + 'px';
						}
					}
					myChart.resize();
				}

				ue.interface.ChangeSize = function(data) {
					//alert("I am an alert box!!");
					change(data[0], data[1]);


				};

				ue.interface.TransColor = function(data) {
					myColor = data;
				};

				ue.interface.TransColorFresh = function(data) {
					myColor = data;
					fresh();
				};

				ue.interface.TransData = function(data) {
					//alert(data);
					var obj = JSON.parse(data);
					dataTemp1 = obj.data1;
					dataTemp2 = obj.data2;
					fresh();
				};
				//刷新数据但不刷新动画，只是曲线变化
				ue.interface.Ani = function(data) {
					var myOption = myChart.getOption();
					myChart.setOption(myOption);
				};

				//刷新动画且更新数据
				ue.interface.ReAni = function(data) {
					var myOption = myChart.getOption();
					myChart.clear();
					myChart.setOption(myOption);
				};

				/************下面数据***********/
				ue.interface.TransData1 = function(data) {
					dataTemp1 = data;
					fresh();
				};

				ue.interface.TransData1 = function(data) {
					dataTemp2 = data;
					fresh();
				};

				ue.interface.titleData1 = function(data) {
					titleshow = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titletext = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titleleft = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titletop = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titlebottom = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titleright = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titlefsize = data;
					fresh();
				};
				ue.interface.titleData1 = function(data) {
					titlecolor = data;
					fresh();
				};

				ue.interface.legendData1 = function(data) {
					legendshow = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendname = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendleft = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendtop = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendbottom = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendright = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendiWidth = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendiHeight = data;
					fresh();
				};
				ue.interface.legendData1 = function(data) {
					legendcolor = data;
					fresh();
				};

				ue.interface.splitLineData1 = function(data) {
					xsplitLine = data;
					fresh();
				};
				ue.interface.splitLineData1 = function(data) {
					ysplitLine = data;
					fresh();
				};

				ue.interface.axisLineData1 = function(data) {
					xaxisLineshow = data;
					fresh();
				};
				ue.interface.axisLineData1 = function(data) {
					yaxisLineshow = data;
					fresh();
				};

				ue.interface.axisLabelData1 = function(data) {
					xaxisLabelshow = data;
					fresh();
				};
				ue.interface.axisLabelData1 = function(data) {
					xaxisLabelfsize = data;
					fresh();
				};
				ue.interface.axisLabelData1 = function(data) {
					xaxisLabelcolor = data;
					fresh();
				};
				ue.interface.axisLabelData1 = function(data) {
					yaxisLabelshow = data;
					fresh();
				};
				ue.interface.axisLabelData1 = function(data) {
					yaxisLabelfsize = data;
					fresh();
				};
				ue.interface.axisLabelData1 = function(data) {
					yaxisLabelcolor = data;
					fresh();
				};
				ue.interface.barWidthData1 = function(data) {
					barWidth = data;
					fresh();
				};
			</script>
		</body>
	</html>

	<body>
	</body>
</html>
